﻿<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title>@ViewBag.Title</title>
        @Using(SystemDirectory.Utility, "scripts/jquery-1.6.2.min.js")
        @Using(SystemDirectory.Utility, "scripts/modernizr-1.7.min.js")
        @Using(SystemDirectory.Utility, "scripts/jquery-ui-1.8.16.custom.min.js")
        @Using(SystemDirectory.Utility, "scripts/global.js")
        @Using(SystemDirectory.Scripts, "core.js")
        @Using(SystemDirectory.Utility, "pepper-grinder/jquery-ui-1.8.16.custom.css")
        @Using(SystemDirectory.Utility, "common.css")
        @Using(SystemDirectory.Content, "core.css")
        @RenderSection("header", false)
    </head>
    <body>
        <div class="header">
            @Html.IconButtonLink(Local("WebHomePage"), "home", CommonUrls.DefaultUrl)
            @Html.IconButtonLink(GLocal("UserCenter"), "key", UCenterUrls.DefaultUrl, Controller.IsMatched("home"))
            @if (Self.IsAdministrator)
            {
                @Html.IconButtonLink(Resources.GetString("ControlPanel", null, Routes.ControlPanel), "wrench", CommonUrls.CPDefaultUrl)
            }
            @Html.IconButtonLink(Self.NickName + "，" + GLocal("User.Logout"), "power", CommonUrls.Logout, false, true, new { @style = "float:right" })
        </div>
        <div class="main">
            <div class="mright">
                <div class="rcontainer">
                    <div class="title">@ViewBag.Title</div>
                    @CPHelper.ShowStatus(ViewBag)
                    @RenderBody()
                </div>
            </div>
            <div class="mleft">
                @if ("home".IsMatched(Controller))
                {
                <div class="left-title">@Local("UserCenter")</div>
                <ul class="menu">
                    @AddSubMenu("index", "EditProfile", UCenterUrls.DefaultUrl)
                    @AddSubMenu("changepasswordview", "UCenter.ChangePassword", UCenterUrls.HomeChangePasswordView)
                    @AddSubMenu("questionanswerview", "UCenter.ChangeQuestionAnswer", UCenterUrls.HomeQuestionAnswerView)
                    @AddSubMenu("diskview", "UCenter.DiskManagement", UCenterUrls.HomeDiskView)
                </ul>
                }
            </div>
            <div class="clear"></div>
        </div>
        <iframe frameborder="0" scrolling="no" id="dialog-container"/>
    </body>
</html>

@helper AddSubMenu(string action, string display, string url)
{
    <li @if (action.IsMatched(Action))
        {<text>class="current" </text>}><a href="@url">@Local(display)</a></li>
}